package com.ruoyi.yljf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.yljf.mapper.GoodsMapper;
import com.ruoyi.yljf.domain.Goods;
import com.ruoyi.yljf.service.IGoodsService;

/**
 * 商品管理Service业务层处理
 * 
 * @author TATAT
 * @date 2025-03-25
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
    @Autowired
    private GoodsMapper goodsMapper;
    
    /**
     * 查询商品管理列表
     * 
     * @param goods 商品管理
     * @return 商品管理
     */
    @Override
    public List<Goods> selectGoodsList(Goods goods) {
    	LambdaQueryWrapper<Goods> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotEmpty(goods.getName())) {
			queryWrapper.like(Goods::getName, goods.getName());
		}
        if (StringUtils.isNotEmpty(goods.getImg())) {
			queryWrapper.eq(Goods::getImg, goods.getImg());
		}
        if (StringUtils.isNotNull(goods.getPrice())) {
			queryWrapper.eq(Goods::getPrice, goods.getPrice());
		}
        return goodsMapper.selectList(queryWrapper);
    }
}
